/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ronsicecream.pos.entities;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author user
 */
@Entity
@Table(name = "pos_master_satuan")
@XmlRootElement
//@NamedQueries({
//    @NamedQuery(name = "PosMasterSatuan.findAll", query = "SELECT p FROM PosMasterSatuan p"),
//    @NamedQuery(name = "PosMasterSatuan.findBySync", query = "SELECT p FROM PosMasterSatuan p WHERE p.sync = :sync"),
//    @NamedQuery(name = "PosMasterSatuan.findBySatuanId", query = "SELECT p FROM PosMasterSatuan p WHERE p.satuanId = :satuanId"),
//    @NamedQuery(name = "PosMasterSatuan.findBySatuanCode", query = "SELECT p FROM PosMasterSatuan p WHERE p.satuanCode = :satuanCode"),
//    @NamedQuery(name = "PosMasterSatuan.findBySatuanName", query = "SELECT p FROM PosMasterSatuan p WHERE p.satuanName = :satuanName")})
public class PosMasterSatuan implements Serializable {
    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private String sync;
    @Id
    @Basic(optional = false)
    @Column(name = "satuan_id")
    private Integer satuanId;
    @Column(name = "satuan_code")
    private String satuanCode;
    @Column(name = "satuan_name")
    private String satuanName;
   
    public PosMasterSatuan() {
    }

    public PosMasterSatuan(Integer satuanId) {
        this.satuanId = satuanId;
    }

    public String getSync() {
        return sync;
    }

    public void setSync(String sync) {
        this.sync = sync;
    }

    public Integer getSatuanId() {
        return satuanId;
    }

    public void setSatuanId(Integer satuanId) {
        this.satuanId = satuanId;
    }

    public String getSatuanCode() {
        return satuanCode;
    }

    public void setSatuanCode(String satuanCode) {
        this.satuanCode = satuanCode;
    }

    public String getSatuanName() {
        return satuanName;
    }

    public void setSatuanName(String satuanName) {
        this.satuanName = satuanName;
    }

   

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (satuanId != null ? satuanId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PosMasterSatuan)) {
            return false;
        }
        PosMasterSatuan other = (PosMasterSatuan) object;
        if ((this.satuanId == null && other.satuanId != null) || (this.satuanId != null && !this.satuanId.equals(other.satuanId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return satuanName;
//        return "com.buanalintas.ronsicecream.pos.entities.PosMasterSatuan[ satuanId=" + satuanId + " ]";
    }
    
}
